//
//  DCMineVCTableCell.m
//  Demo
//
//  Created by Kyle on 2023/1/1.
//

#import "DCMineVCTableCell.h"


@interface DCMineVCTableCell ()

@property (nonatomic, strong) UIImageView *logoImage;

@property (nonatomic, strong) UILabel *nameLabel;

@property (nonatomic, strong) UIImageView *rightImage;

@property (nonatomic, strong) UIView *bottomLine;

@end

@implementation DCMineVCTableCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self configureUI];
    }
    return self;
}
- (void)setDataWithDic:(NSDictionary *)data lineHidden:(BOOL)hidden {
    _logoImage.image = [UIImage imageNamed:data[@"imageName"]];
    _nameLabel.text = data[@"titleName"];
    _bottomLine.hidden = hidden;
}

- (void)configureUI {
    self.backgroundColor = [UIColor colorWithString:@"#FFFFFF"];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    _logoImage = [[UIImageView alloc] init];
//    _logoImage.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:_logoImage];
    [_logoImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(52);
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
        make.width.height.mas_equalTo(25);
    }];
    
    _nameLabel = [UILabel new];
    _nameLabel.font = DCFont_PF_Regular(13);
    _nameLabel.textColor = [UIColor colorWithString:@"#1C221B"];
    _nameLabel.text = @"namelabel";
    [self.contentView addSubview:_nameLabel];
    [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_logoImage.mas_right).mas_offset(14);
        make.centerY.mas_equalTo(self.contentView);
    }];
    
    _rightImage = [UIImageView new];
    _rightImage.image = [UIImage imageNamed:@"rightInto"];
//    _rightImage.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:_rightImage];
    [_rightImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-47);
        make.centerY.mas_equalTo(self.contentView);
        make.width.mas_equalTo(7);
        make.height.mas_equalTo(12);
    }];
    
    _bottomLine = [UIView new];
    _bottomLine.backgroundColor = [UIColor colorWithString:@"#DFDFDF"];
    [self.contentView addSubview:_bottomLine];
    [_bottomLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(17);
        make.right.mas_equalTo(-17);
        make.bottom.mas_equalTo(0);
        make.height.mas_equalTo(1);
    }];
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
